package com.example.first_android.fragment

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import com.example.first_android.R


class DetailFragment : Fragment() {
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_detail, container, false)
    }
@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    view.findViewById<TextView>(R.id.title).text = "大山炮出现了！！！！"
    view.findViewById<TextView>(R.id.content).text = "张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！张济华大山炮！"
    view.findViewById<Button>(R.id.back_button).setOnClickListener{
        parentFragmentManager.popBackStack()
    }
}
}